<html>
<head><meta charset="utf-8"><title>nixos support · t-compiler/cargo-bisect-rustc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/index.html">t-compiler/cargo-bisect-rustc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html">nixos support</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203646695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646695">(Jul 12 2020 at 14:49)</a>:</h4>
<p>Just tried out cargo-bisect-rustc for the first time and it worked great - really awesome work! </p>
<p>I did have to make some changes to get it working on NixOS though (the same issue might affect some other people who work on the compiler, I <em>think</em> <span class="user-mention silent" data-user-id="119009">eddyb</span>, <span class="user-mention silent" data-user-id="123586">nagisa</span> and <span class="user-mention silent" data-user-id="124288">oli</span> are also NixOS users). </p>
<p>Because cargo-bisect-rustc downloads pre-built toolchains, they won't work out-of-the-box on NixOS where interpreter and shared objects don't live in a normal place, so they have to be run through patchelf to work (e.g. rustup is patched to do this on NixOS).</p>
<p>You can find <a href="https://github.com/davidtwco/veritas/commit/08620b1ac3ec45f988b956285a43d347b963fdda">the patch I've made here</a> - which might be useful for anyone else that has this issue. I'm not sure how easy it would be to transform into something upstreamable.</p>



<a name="203646764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646764">(Jul 12 2020 at 14:50)</a>:</h4>
<p>You can avoid the <code>--set-interpreter</code> by just calling interpreter directly (i.e. <code>ld-linux.so.1 $command $args</code>.</p>



<a name="203646770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646770">(Jul 12 2020 at 14:51)</a>:</h4>
<p>How would I do that when cargo-bisect-rustc is invoking the compiler?</p>



<a name="203646782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646782">(Jul 12 2020 at 14:51)</a>:</h4>
<p>similarly for <code>--rpath</code>, just set <code>LD_LIBRARY_PATH</code>. That should reduce the overhead of spawning the compiler at least somewhat.</p>



<a name="203646828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646828">(Jul 12 2020 at 14:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/217417-t-compiler.2Fcargo-bisect-rustc/topic/nixos.20support/near/203646782">said</a>:</p>
<blockquote>
<p>similarly for <code>--rpath</code>, just set <code>LD_LIBRARY_PATH</code>. That should reduce the overhead of spawning the compiler at least somewhat.</p>
</blockquote>
<p>that probably would have been an easier solution</p>



<a name="203646834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646834">(Jul 12 2020 at 14:52)</a>:</h4>
<p>IIRC cargo-bisect-rustc had arguments that allowed you to modify exactly how it spawns things</p>



<a name="203646837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646837">(Jul 12 2020 at 14:52)</a>:</h4>
<p>Something that we should add to the docs?</p>



<a name="203646844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646844">(Jul 12 2020 at 14:52)</a>:</h4>
<p>I think you can supply it with the test command or something? I remember writing a wrapper shell script that invoked rustc the right way and passing it into <code>cargo-bisect-rustc</code>, but it was a while ago.</p>



<a name="203646848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646848">(Jul 12 2020 at 14:53)</a>:</h4>
<p>ah, I could have used <code>--script</code> and <code>LD_LIBRARY_PATH</code>, I see</p>



<a name="203646854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646854">(Jul 12 2020 at 14:53)</a>:</h4>
<p>well, I over-complicated this - hopefully it's still useful to someone</p>



<a name="203646856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646856">(Jul 12 2020 at 14:53)</a>:</h4>
<p>Yeah, its cool ^^</p>



<a name="203646863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646863">(Jul 12 2020 at 14:53)</a>:</h4>
<p>/me'd use it if they don't forget it before next time they need to bisect</p>



<a name="203646864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646864">(Jul 12 2020 at 14:53)</a>:</h4>
<p>Sorry!  The documentation could use an update. We've added quite a bit since we last touched the docs</p>



<a name="203646915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203646915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203646915">(Jul 12 2020 at 14:54)</a>:</h4>
<p>I saw <code>--script</code> in the docs, I just didn't think to use it to workaround my issue with the interpreter.</p>



<a name="203647095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos%20support/near/203647095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/217417-t-compiler/cargo-bisect-rustc/topic/nixos.20support.html#203647095">(Jul 12 2020 at 14:59)</a>:</h4>
<p>Definitely check out the <code>--access github</code> option if you haven't discovered it yet.  Saves a good deal of time</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>